package com.ym.manager.yinsheng.util;

public class YsKJEnum {

    private final static String NUKNOW = "未知枚举";

    /**
     * 银行卡绑定
     */
    public enum TRUSTEESHIPSTATUS{
        签约成功("SUCCESS","签约成功"),
        签约登记成功("WAIT_CONFIRM","签约登记成功"),
        签约失败("FAILED","签约失败"),
        已解约("INVALID","已解约"),
        银盛响应成功("SYS000","响应成功"),
        银盛业务响应成功("COM000","业务受理成功"),
        银盛业务响应处理中("COM004","业务受理处理中");
        /** 状态值 */
        private String code;
        private String desc;

        TRUSTEESHIPSTATUS(String code,String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }

        public static String getDescByCode(String code) {
            for (TRUSTEESHIPSTATUS value : TRUSTEESHIPSTATUS.values()) {
                if (value.getCode().equals(code)) {
                    return value.getDesc();
                }
            }
            return "";
        }
    }

    /**
     * 充值
     */
    public enum FASTPAY{
        充值成功("TRADE_SUCCESS","充值成功"),充值处理中("TRADE_PROCESS","充值处理中"),充值失败("TRADE_FAILD","充值失败"),充值取消("TRADE_CANCEL","充值取消");

        /** 状态值 */
        private String code;
        private String desc;

        FASTPAY(String code,String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }

        public static String getDescByCode(String code) {
            for (FASTPAY value : FASTPAY.values()) {
                if (value.getCode().equals(code)) {
                    return value.getDesc();
                }
            }
            return "";
        }
    }


    /**
     * 提现
     */
    public enum SINGLENORMALDF{
        提现成功("TRADE_SUCCESS","提现成功"),申请提现成功("TRADE_ACCEPT_SUCCESS","申请提现成功"),提现失败("TRADE_FAILURE","提现失败"),退票成功("DISHONOUR_SUCCESS","退票成功");

        /** 状态值 */
        private String code;
        private String desc;

        SINGLENORMALDF(String code,String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }

        public static String getDescByCode(String code) {
            for (SINGLENORMALDF value : SINGLENORMALDF.values()) {
                if (value.getCode().equals(code)) {
                    return value.getDesc();
                }
            }
            return "";
        }
    }

    /** -----------------------------红包start----------------------------------**/
    // 红包类型
    public enum RedPackageType {
        Single("1", "单个红包"), GroupLuck("2", "手气红包"),
        GroupNormal("3", "普通红包"), GroupPersonal("4", "专属红包");
        private String code;
        private String name;

        RedPackageType(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public static RedPackageType getObjectByCode(String key) {
            for (RedPackageType object : RedPackageType.values()) {
                if (object.getCode().equals(key)) {
                    return object;
                }
            }
            return null;
        }
        public static String getDescByCode(String code) {
            for (RedPackageType value : RedPackageType.values()) {
                if (value.code.equals(code)) {
                    return value.name;
                }
            }
            return "";
        }
    }

    // 红包状态
    public enum RedPackageStatus {
        NoPay("0", "未支付"),Processing("1", "进行中"),
        Complete("2", "已完成"), Expire("3", "已过期");
        private String code;
        private String name;

        RedPackageStatus(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public static RedPackageStatus getObjectByCode(String key) {
            for (RedPackageStatus object : RedPackageStatus.values()) {
                if (object.getCode().equals(key)) {
                    return object;
                }
            }
            return null;
        }

        public static String getDescByCode(String code) {
            for (RedPackageStatus value : RedPackageStatus.values()) {
                if (value.code.equals(code)) {
                    return value.name;
                }
            }
            return "";
        }

        public static String getShowType(String code){
            if(code.equals("1")){
                return "1";
            }else {
                return "2";
            }
        }

        public static boolean showHis(String code){
            if(code.equals("1")){
                return true;
            }else {
                return false;
            }
        }
    }

    // 提现状态
    public enum TransferStatus {

        APPLY_FAIL("1", "申请失败"), APPLY_SUCCESS("2", "申请成功"),
        TRANSFER_SUCCESS("3", "转账成功"),TRANSFER_FAIL("4", "转账失败");

        private String code;
        private String name;

        TransferStatus(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public static String getDescByCode(String code) {
            for (TransferStatus value : TransferStatus.values()) {
                if (value.code.equals(code)) {
                    return value.name;
                }
            }
            return "";
        }
    }
    /** -----------------------------红包end----------------------------------**/

    // 提现状态
    public enum WithdrawStatus {

        APPLY_WITHDRAWAL("1", "提现中"), WITHDRAWAL_SUCCESS("2", "提现成功"),
        WITHDRAWAL_FAIL("3", "提现失败"),WITHDRAWAL_WAIT("4", "提现审核"),
        WITHDRAWAL_EXC("5", "提现异常");

        private String code;
        private String name;

        WithdrawStatus(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }
    // 提现审核状态
    public enum WithdrawWaitStatus {

        APPLY_WITHDRAWAL("1", "待审核"), WITHDRAWAL_SUCCESS("2", "通过"),
        WITHDRAWAL_FAIL("3", "冻结");

        private String code;
        private String name;

        WithdrawWaitStatus(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }
}
